package com.doctcloud.hisinfo.medrec.controller;

import com.doctcloud.hisinfo.histable.domain.medrec.PatVisitDo;
import com.doctcloud.hisinfo.medrec.service.impl.PatVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

import static com.doctcloud.common.core.utils.DateUtils.startOfDay;

@RestController
@RequestMapping(value = "/medrec/")
public class PatVisitController {
    @Autowired
    private PatVisitService patVisitService;
    @GetMapping("/patvisit/adminAfterDate")
    public List<PatVisitDo> adminAfterDate(@RequestParam("statDate") Date startDate){
        startDate = startOfDay(startDate);
        return patVisitService.adminAfter(startDate);
    }
    @GetMapping("/patvisit/dischargeAfterDate")
    public List<PatVisitDo> dischargeAfterDate(@RequestParam("statDate") Date startDate){
        startDate = startOfDay(startDate);
        return patVisitService.dischargeAfter(startDate);
    }
}
